<?php
error_reporting(0);
session_start();
include_once '../comm/config.php';
include_once '../comm/checkpostandget.php';
include_once 'check.php';
include_once 'page.class.php';
include_once '../comm/wjt.php';

$keyword=$_GET["keyword"]; 
$act=$_GET['act'];
$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize=10;
$page2=($page-1)*$pagesize;

if (!$act) {
	echo "缺少必要参数";
	exit;
}
else
{
	if($act=='in'){
		$sql="select * from ".$BIAOTOU."mingxi where ddusername='".$_SESSION["duoduouser"]."'";
		$rs = mysql_query($sql);
		$total = mysql_num_rows($rs);	
		$sql="select * from ".$BIAOTOU."mingxi where ddusername='".$_SESSION["duoduouser"]."' order by addtime desc limit $page2,$pagesize";
		$rs = mysql_query($sql);
	}
	if($act=='out'){
		$sql="select * from ".$BIAOTOU."tixian where ddusername='".$_SESSION["duoduouser"]."'";
		$rs = mysql_query($sql);
		$total = mysql_num_rows($rs);	
		$sql="select * from ".$BIAOTOU."tixian where ddusername='".$_SESSION["duoduouser"]."' order by addtime desc limit $page2,$pagesize";
		$rs = mysql_query($sql);
	}
}

$tag="center";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>我的账户明细 - 用户中心</title>
<link href="../css/usercss.css" rel="stylesheet" type="text/css">
<link href="../template/<?=MOBAN?>/css/common.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../js/jquery.js"></script>
</head>

<body id="mingxilist">
<?php
include("../template/".MOBAN."/header.tpl.php");
?>
<?php
include("../template/".MOBAN."/nav.tpl.php");
?>
<div id="main">
<?php
include("left.php");
?>
<div class="contain">
  <h2 class="left_nav5">我的账户明细</h2>
    <div class="order">
      <div class="title">
          <ul>
            <li><a style="MARGIN-LEFT: 10px" <?php if($act=='in') echo "class=\"current\"";?>
  href="mingxilist.php?act=in">我的收入明细</a></li>
  			<li><a style="MARGIN-LEFT: 10px" <?php if($act=='out') echo "class=\"current\"";?>
  href="mingxilist.php?act=out">我的提现明细</a></li>
          </ul>
      </div>
    <div class="content">
      <ul style="width:710px">
	  		<?php if($act=='in'){?>
				<li class="order_title">
				<div class="item" style="width:150px">&nbsp;&nbsp;收入事件</div>
				<div class="item" style="width:300px">收入说明</div>
				<div class="item" style="width:120px;text-align:center">收入金额</div>
				<div class="item" style="width:140px;text-align:center">收入时间</div>
				</li>
			<?php
			while ($row = mysql_fetch_array($rs))
			{
				echo "<li><div class=\"item\" style=\"width:150px\">&nbsp;&nbsp;".$row["shijian"]."</div>";
				echo "<div class=\"item\" style=\"width:300px\">".$row["memo"]."</div>";
				echo "<div class=\"item\" style=\"width:120px;text-align:center\">".$row["je"]."</div>";						
				echo "<div class=\"item\" style=\"width:140px;text-align:center\">".$row["addtime"]."</div>";
				echo "</li>";
			}
			?></ul>
			
			<?php }?>	
		  		<?php if($act=='out'){?>
				<li class="order_title">
				<div class="item" style="width:150px">&nbsp;&nbsp;收款支付宝</div>
				<div class="item" style="width:100px;text-align:center">提现金额</div>											
				<div class="item" style="width:160px;text-align:center">提现状态</div>
				<div class="item" style="width:160px;text-align:center">提现IP</div>
				<div class="item" style="width:140px;text-align:center">提现时间</div>
				</li>
			<?php
			while ($row = mysql_fetch_array($rs))
			{
				if($row["txstate"]=='0'){
					$txs="<font color=#dd0000>处理中...</font>";
				}elseif($row["txstate"]=='1'){
					$txs="<font color=#009900>提现成功</font>";
				}else{
					$txs="<font color=#333333>提现失败</font>";
				}
				echo "<li><div class=\"item\" style=\"width:150px\">&nbsp;&nbsp;".$row["zfb"]."</div>";
				echo "<div class=\"item\" style=\"width:100px;text-align:center\">".$row["txje"]."</div>";				
				echo "<div class=\"item\" style=\"width:160px;text-align:center\">".$txs."</div>";					
				echo "<div class=\"item\" style=\"width:160px;text-align:center\">".$row["addip"]."</div>";
				echo "<div class=\"item\" style=\"width:140px;text-align:center\">".$row["addtime"]."</div>";
				echo "</li>";
			}
			?></ul>
			<?php }?>	
	</div>
	</div>
</div>
	<div class="megas512" style="clear:both"><?php pageft($total,$pagesize,1,1,0,10,"mingxilist.php?act=".$act."");	echo $pagenav;?></div>
</div>
<?php
include("../template/".MOBAN."/footer.tpl.php");
mysql_close();
?>
</body>
</html>